package com.example.demo.jpa.customer.service;

import com.example.demo.jpa.customer.dao.CustomerDAO;
import com.example.demo.jpa.customer.dto.CustomerCommand;
import com.example.demo.jpa.customer.dto.CustomerDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class CustomerService {

    @Autowired
    CustomerDAO customerDAO;

    public CustomerDTO findCustomerByID(long id){
        return customerDAO.findCustomerByID(id);
    }
    public CustomerDTO createCustomer(CustomerCommand customerCommand){
        return customerDAO.createCustomer(customerCommand);
    }
    public CustomerDTO updateCustomer(long id,CustomerCommand customerCommand){
        return customerDAO.updateCustomer(id,customerCommand);
    }


    public void deleteCustomerById(Long id) {
        customerDAO.deleteCustomerById(id);
    }
}
